package com.example.hxpc.guidancemanagement.tools.mold;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Created by tao on 2017/12/7.
 * 该类是为了解决RecyclerView和GridView嵌套式滑动中复用的问题
 * 该类禁止了GridView的滑动功能，有多少内容就显示多少内容
 */

public class MyGridView extends GridView{
    public MyGridView(Context context) {
        super(context);
    }

    public MyGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2 ,MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
